import get from '@dfeidao/atom-web/global/get';
import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import render from '@dfeidao/atom-web/render/render';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
import p001 from './p001';
import p002 from './p002';
interface Iparam extends Event {
	page_no: 1;
}
export default async function a001(fd: IFeidaoAiBrowserComponent, res: string, a: Iparam) {
	// const ress = await get('res');\
	console.log("123123123" + res);
	console.log(JSON.parse(res).res);
	render(fd, JSON.parse(res).res, p001, 'p001', 'inner');
	render(fd, { a: 2, total: JSON.parse(res).ress }, p002, 'p002', 'inner');
	const d = fd.data.node.querySelector<HTMLDivElement>('[data-id="none"]');
	if ((JSON.parse(res).ress) === 0) {
		set_node_cls(d, 'display-n', false);
	}

}
